package cn.iocoder.yudao.module.digital.job.cardchannel;//package cn.iocoder.yudao.module.digital.job.cardkeymanager;

import cn.hutool.core.util.IdUtil;
import cn.iocoder.yudao.framework.quartz.core.handler.JobHandler;
import cn.iocoder.yudao.module.digital.service.cardchannel.ICardSecretManager;
import cn.iocoder.yudao.module.infra.util.TraceIdUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

@Component
@Slf4j
public class CardSecretOrderJob implements JobHandler {
    @Resource
    private ICardSecretManager cardSecretManager;

    @Override
    public String execute(String param) throws Exception {
        try {
            TraceIdUtil.setTraceId(IdUtil.fastSimpleUUID());
            cardSecretManager.pollTimeoutUnSuccessfulOrders();
        } catch (Exception e) {
            log.error("重查超时订单-异常", e);
        } finally {
            TraceIdUtil.removeTraceId();
        }
        return "";
    }

}
